home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / Sample Editors⁄Viewers / Draw Editor / Source / Promise.h < prev    next >
Encoding:
Text File  |  1995-12-11  |  2.6 KB  |  119 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Palette.h
  3.  
  4.     Contains:    Palette Classes Definition
  5.  
  6.     Written by:    Dave Stafford
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. // -- Compiler/Preprocessor Switches --
  12.  
  13. #ifndef _PROMISE_
  14. #define _PROMISE_
  15.  
  16. #ifndef _COMPILERDEFS_
  17. #include "CompDefs.h"
  18. #endif
  19.  
  20. #ifndef _DRAWEDITORDEF_
  21. #include "DrawEditorDef.h"
  22. #endif
  23.  
  24. //=============================================================================
  25. // Forward Declarations
  26. //=============================================================================
  27. class DrawEditor;
  28. class CSelection;
  29. class ODFrame;
  30. class COrderedList;
  31. class CDrawContent;
  32.  
  33. //=============================================================================
  34. // Constants
  35. //=============================================================================
  36.  
  37. //=============================================================================
  38. // CPromise
  39. //=============================================================================
  40. class CPromise
  41. {
  42. public:
  43.     
  44.     // -- Init --
  45.     CPromise(DrawEditor* editor, 
  46.                     ODFrame* sourceFrame, 
  47.                     COrderedList* shapeList,
  48.                     ODCloneKind kind);
  49.  
  50.     CPromise(DrawEditor* editor, 
  51.                     ODFrame* sourceFrame, 
  52.                     CSelection* selection, 
  53.                     ODCloneKind kind);
  54.     ~CPromise();
  55.  
  56. public:
  57.     virtual void     FulfillPromise(Environment* ev, ODStorageUnit* storage);
  58.     void             FulfillPromise(Environment* ev, ODStorageUnitView* view);
  59.     void             Promise(Environment *ev, ODStorageUnit* storageUnit);
  60.     ODBoolean        OKToDelete()
  61.     {
  62.         return (fCloneKind != kODCloneToLink);  
  63.     }
  64.     COrderedList* GetShapeList();
  65.     CDrawContent* GetPromiseContent();
  66.  
  67.     
  68.  
  69. //----------------------------------------------------------------------------------------
  70. // Data Members
  71. //
  72. //
  73. //
  74. //
  75. protected:
  76.     ODFrame*            fSourceFrame;
  77.     DrawEditor*            fDrawEditor;
  78.     
  79.     ODCloneKind            fCloneKind;
  80.     CDrawContent*        fPromiseContent;
  81.     
  82. };
  83.  
  84.  
  85.  
  86. //=============================================================================
  87. // CClipboardPromise
  88. //=============================================================================
  89. class CClipboardPromise: public CPromise
  90. {
  91. public:
  92.     
  93.     // -- Init --
  94.     CClipboardPromise(DrawEditor* editor, 
  95.                     ODFrame* sourceFrame, 
  96.                     CSelection* selection, 
  97.                     ODCloneKind kind,
  98.                     ODUpdateID updateID);
  99.     ~CClipboardPromise();
  100.  
  101. public:
  102.  
  103.     virtual void     FulfillPromise(Environment* ev, ODStorageUnit* storage);
  104.     virtual void     Promise(Environment *ev, ODStorageUnit* storageUnit);
  105.     virtual void     ShapesPromisedToClipboard(Environment *ev, ODBoolean promised);
  106.     ODUpdateID         GetUpdateID();
  107.  
  108. private:
  109.     // Used to test clipboard for our promises.
  110.     ODUpdateID    fUpdateID;  
  111.  
  112.  
  113. };
  114.  
  115.  
  116.  
  117.  
  118.  
  119. #endif